<?php

/**
 * Mailbox form base class.
 *
 * @package    alika
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseMailboxForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'from_id'         => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'to_id'           => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'title'           => new sfWidgetFormInput(),
      'body'            => new sfWidgetFormTextarea(),
      'pub'             => new sfWidgetFormInputCheckbox(),
      'created_at'      => new sfWidgetFormDateTime(),
      'updated_at'      => new sfWidgetFormDateTime(),
      'fl_read'         => new sfWidgetFormInputCheckbox(),
      'del_sender'      => new sfWidgetFormInputCheckbox(),
      'del_resiver'     => new sfWidgetFormInputCheckbox(),
      'comment'         => new sfWidgetFormTextarea(),
      'translate'       => new sfWidgetFormTextarea(),
      'fl_translate'    => new sfWidgetFormInput(),
      'fl_reply'        => new sfWidgetFormInput(),
      'free'            => new sfWidgetFormInputCheckbox(),
      'from_partner_id' => new sfWidgetFormInput(),
      'to_partner_id'   => new sfWidgetFormInput(),
      'parent_id'       => new sfWidgetFormPropelChoice(array('model' => 'Mailbox', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorPropelChoice(array('model' => 'Mailbox', 'column' => 'id', 'required' => false)),
      'from_id'         => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'to_id'           => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'title'           => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'body'            => new sfValidatorString(array('required' => false)),
      'pub'             => new sfValidatorBoolean(),
      'created_at'      => new sfValidatorDateTime(array('required' => false)),
      'updated_at'      => new sfValidatorDateTime(array('required' => false)),
      'fl_read'         => new sfValidatorBoolean(),
      'del_sender'      => new sfValidatorBoolean(),
      'del_resiver'     => new sfValidatorBoolean(),
      'comment'         => new sfValidatorString(array('required' => false)),
      'translate'       => new sfValidatorString(array('required' => false)),
      'fl_translate'    => new sfValidatorInteger(),
      'fl_reply'        => new sfValidatorInteger(array('required' => false)),
      'free'            => new sfValidatorBoolean(),
      'from_partner_id' => new sfValidatorInteger(array('required' => false)),
      'to_partner_id'   => new sfValidatorInteger(array('required' => false)),
      'parent_id'       => new sfValidatorPropelChoice(array('model' => 'Mailbox', 'column' => 'id')),
    ));

    $this->widgetSchema->setNameFormat('mailbox[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Mailbox';
  }


}
